<div id="blog">
<h2>Stuff Needs<?php addPost('stuff'); ?></h2>
<div class="posts" id="posts">
<?php 
$siteid = $site['id'];
$postsqry = dbSelect('posts',array("site_id=$siteid","parent_id=0","type_id=5"),"ORDER BY publishdate DESC");
$postcnt = 0;
if(mysql_numrows($postsqry) > 0){ 
	while($posts = mysql_fetch_array($postsqry)){
		$userid = $posts['author_id'];
		$author = mysql_fetch_array(dbSelect('users',array("id=$userid")));
		$authorname = $author['firstname'].' '.$author['lastname'];
		$nicetime = nicetime($posts['publishdate']);
?>
	<div class="post">
		<div class="post_title"><?php echo $posts['title']; ?></div>
		<span class="post_author"><?php echo $authorname; ?></span>&nbsp;
		<span class="post_body"><?php echo urldecode($posts['post']); ?></span>
		<div class="post_datetime"><?php if($nicetime){echo $nicetime;} ?></div>
		
		<?php if($posts['need_answereddate'] =="0000-00-00"){ ?>
			<div class="comments">
				<h2><small>Contact Info</small></h2>
					<div class="comment">
						<?php if($posts['contactname']){echo '<strong>Contact: </strong>'.urldecode($posts['contactname']).'';} ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<?php if($posts['contactphone']){echo '<strong>Phone: </strong>'.urldecode($posts['contactphone']).'';} ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<?php if($posts['contactemail']){echo '<strong>Email: </strong><a href="mailto:'.urlencode($posts['contactemail']).'">'.urldecode($posts['contactemail'].'</a>').'';} ?>
					</div>
			</div>
		<?php }else{ ?>
			<br />
			<div class="comments">
			<h2><small>The Answer</small></h2>
				<div class="comment">
					<span class="comments_body "><?php echo urldecode($posts['need_answer']); ?></span>
					<div class="comments_datetime"><?php echo nicetime($posts['need_answereddate']); ?></div>
				</div>
			</div>
		<?php } ?>
		<?php editDel($posts['id'],$posts['author_id'],'stuff'); ?>
	</div><!--/post-->
<?php
$postcnt++;
	} /* /while posts */
} /* /if posts */
?>
</div><!--/posts-->
</div><!--/blog-->